package com.hl.card.modular.packBack.controller;

import com.alibaba.fastjson.JSONObject;
import com.hl.card.common.controller.BaseController;
import com.hl.card.common.util.CommonUtil;
import com.hl.card.common.util.ResponseData;
import com.hl.card.modular.packBack.service.IntegralManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 比豆流水明细管理前端控制
 * 
 * @author zhouyongbang
 * @Date 2018-06-12 09:37:08
 */
@Controller
@RequestMapping("/integralManag")
/*@RequestMapping("/api/integralManag")*/
public class IntegralManageController extends BaseController {
	@Autowired
	private IntegralManageService integralManageService;
	
	@Autowired
	private ResponseData responseData;
	
	private String PREFIX = "/dist/integralManag/";
	
	/**
     *   比豆流水明细主页
     */
    @RequestMapping("")
    public String index(){
        return PREFIX+"integralManag.html";
    }
	/**
	 * 
	 * @param start end
	 * @return
	 */
	@RequestMapping("/queryIntegralManage")
	@ResponseBody
	public Object queryIntegralManage(Integer start,Integer end,String createTime, String endTime,String flowType,String merchantOrderNumber,String scoreFlowNumber,String dealRecordNumber,String othersAccount,String scoreFlowDirection) {
		responseData.setData(null);
		if (CommonUtil.isEmpty(start)) {
			responseData.setStatus("0");
			responseData.setMsg("不能为空");
			return responseData;
		}
		if(end==null||"".equals(end))
		{
			end=1;
		}
		 JSONObject responseData= integralManageService.queryIntegralManage(start,end,createTime,endTime,flowType,merchantOrderNumber,scoreFlowNumber,dealRecordNumber,othersAccount,scoreFlowDirection);
		
		System.out.println(responseData.get("list"));
		return responseData.get("list");
	}

 }
